#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
using namespace std;
int main()
{
	int n;
	cin >> n;
	int sum = 0;
	int result = 1;
	for (int j = n; j > 0; j--)
	{
		for (int i = 1; i <= n; i++)
		{
			result = result * i;
		}
		sum += result;
	}
	cout << sum;
	return 0;

}